/**
 * Copyright (C), 2015-2019, XXX有限公司
 * FileName: UserService
 * Author:   kadibeieun
 * Date:     2019/9/3 10:22
 * Description:
 * History:
 * <author>          <time>          <version>          <desc>
 * 作者姓名           修改时间           版本号              描述
 */
package com.afd.service;

import com.afd.mapper.UserMapper;
import com.afd.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 〈一句话功能简述〉<br> 
 * 〈〉
 *
 * @author kadibeieun
 * @create 2019/9/3
 * @since 1.0.0
 */
@Service
public class UserService {

    @Autowired
    private UserMapper userMapper;

    public User queryById(Long id){
       return userMapper.selectByPrimaryKey(id);
    }


    @Transactional()
    public void deleteById(Long id){
        this.userMapper.deleteByPrimaryKey(id);
    }

    public List<User> queryAll(){
        List<User> users = this.userMapper.selectAll();
        return users;
    }

}